import { getLang, setLang, removeLang } from "@/utils/lang";

const LANG = {
  state: {
    lang: "CN"
  },
  mutations: {
    SET_LANG: (state, lang) => {
      state.lang = lang;
    }
  },
  actions: {
    toChinese({ commit }) {
      commit("SET_LANG", "CN");
      setLang("");
    },
    toEnglish({ commit }) {
      commit("SET_LANG", "en");
      setLang("en");
    }
  }
};

export default LANG;
